import java.util.Scanner;

public class Compara_5 {
    public static void main(String[] args) {
        Scanner input= new Scanner(System.in);
        double basic=0;
        double max = 0;
        double min=0;
        for (int i=1;;i++) {
            System.out.println("请输入第" + i + "个数");
            double a = input.nextDouble();
            if (a==0){
                break;
            }else if (basic==0){
                basic=a;
                min=a;
                continue;
            }else if (a>basic){
                max=a;
                basic=a;
            }else{
                min=a;
                basic=a;
            }

        }
        System.out.println("最大值"+max);
        System.out.println("最小值"+min);

        }

}
